using System;
using System.Collections.Generic;
using System.Text;
using SubManager.Entity;

namespace SubManager.DAL
{
    /// <summary>
    /// Data Access Object for <see cref="UserEntity"/>.
    /// </summary>
    public class UserDao
    {
        /// <summary>
        /// Create UserEntity and save to data store.
        /// </summary>
        /// <param name="user">UserEntity</param>
        /// <returns>true if success, else false.</returns>
        public static bool Create(UserEntity user)
        {
            return Db4oHelper<UserEntity>.Create(user);
        }

        public static bool Retrive(UserEntity user)
        {
            return Db4oHelper<UserEntity>.Retrive(user);
        }

        public static bool Update(UserEntity entity)
        {
            return Db4oHelper<UserEntity>.Update(entity);
        }

        public static bool Delete(UserEntity user)
        {
            return Db4oHelper<UserEntity>.Delete(user);
        }

        public static List<UserEntity> Query(UserEntity user)
        {
            return Db4oHelper<UserEntity>.QueryByExample(user);
        }

        
    }
}
